# Makefile for Open Tool Chain v2.0, run on iPhone
#
# apt-get install com.bigboss.20toolchain make ldid
# make
# make install

CC = gcc
LD = $(CC)
VERSION = 2.3.0
LDFLAGS = -framework Foundation \
          -framework CoreFoundation \
          -framework UIKit \
          -framework QuartzCore \
          -framework CoreGraphics \
          -framework GraphicsServices \
          -framework CoreSurface \
          -framework CoreAudio \
          -framework Celestial \
          -framework AudioToolbox \
          -lobjc \
          -L"/usr/lib" \
          -F"/System/Library/Frameworks" \
          -F"/System/Library/PrivateFrameworks" \
          -bind_at_load \
          -multiply_defined suppress \
          -march=armv6 \
          -mcpu=arm1176jzf-s 

CFLAGS = -DVERSION='"$(VERSION)"' -O3 -fno-trapping-math -funroll-loops \
         -march=armv6 -mcpu=arm1176jzf-s 

all:	HelloWorld

HelloWorld:	main.o HelloWorldApp.o MainView.o
	$(LD) $(LDFLAGS) -o $@ $^
	ldid -S $@
	cp $@ /Applications/HelloWorld.app

%.o:	%.m
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o:	%.c
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o:	%.cpp
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@


clean:
	rm -f *.o  HelloWorld *.gch
	

